package org.janon.httpproxy.client.method;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;

import org.janon.httpproxy.ClientReadFromServer;
import org.janon.httpproxy.HttpModel;
import org.janon.httpproxy.HttpSession;
import org.janon.httpproxy.HttpUtil;
import org.janon.httpproxy.RequestLogStream;
import org.janon.httpproxy.client.ClientWrite;

public class PostMethod
{
	public static ClientReadFromServer doMethod(HttpModel httpModel, BufferedInputStream server_in, BufferedOutputStream server_out, BufferedInputStream client_in, BufferedOutputStream client_out, HttpSession session, RequestLogStream rls) throws Exception
	{
		ClientWrite.write(httpModel, server_out, rls);
		return new ClientReadFromServer(server_in, client_out, session, httpModel.getMethodId() == HttpUtil.HTTP_CONNECT, rls);
	}
}
